CC=gcc
#SRC=$(wildcard *.c)
SRC=$(shell ls *.c)
OBJ=$(SRC:.c=.o)
BIN=hello
LFLAG=-o
FLAG=-c
RM=rm -f

$(BIN):$(OBJ)
	@$(CC) $^ $(LFLAG) $@
	@echo "Linking... $^ to $@"
%.o:%.c
	@$(CC) $(FLAG) $< 
	@echo "Compiling... $< to $@"

.PHONY:clean
clean:
	@$(RM) $(OBJ) $(BIN)
